from wcs.libs.items import items
from wcs.libs.players import players

itemName = "Periapt of Health"
item = items.addItem(itemName)
item.setGroup("powerup")
item.setCost(6000)
item.setDescription("Gain extra XP until round end/death")
item.appendToUser = False
item.aliveToUse = True

def wcs_item_bought(event_var):
    """
    Executed when an item is purcahsed. If the item was this item, then add 75
    health to the player's max health pool.
    """
    if event_var['item'] == itemName:
        userid = event_var["userid"]
        player = players[userid]
        player.healthAdd(75)
